package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * The persistent class for the history_salary database table.
 */
@Entity
@Table(name = "history_salary")
@NamedQueries({
        @NamedQuery(name = "HistorySalary.findAll", query = "SELECT h FROM HistorySalary h"),
        @NamedQuery(name = "HistorySalary.findById", query = "SELECT h FROM HistorySalary h WHERE h.id = :id"),
        @NamedQuery(name = "HistorySalary.findBySalary", query = "SELECT h FROM HistorySalary h WHERE h.salary = :salary"),
        @NamedQuery(name = "HistorySalary.findByDateHistory", query = "SELECT h FROM HistorySalary h WHERE h.dateHistory = :dateHistory")})
public class HistorySalary implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Temporal(TemporalType.DATE)
    @Column(name = "date_history", nullable = false)
    private Date dateHistory;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal salary;

    // bi-directional many-to-one association to Employee
    @ManyToOne
    @JoinColumn(name = "id_user", nullable = false)
    private Employee employee;

    public HistorySalary() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getDateHistory() {
        return this.dateHistory;
    }

    public void setDateHistory(Date dateHistory) {
        this.dateHistory = dateHistory;
    }

    public BigDecimal getSalary() {
        return this.salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public Employee getEmployee() {
        return this.employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

}